package com.yz.yzl00.enums;

import com.baomidou.mybatisplus.annotation.IEnum;
import lombok.Getter;

/**
 * @author yz
 * @create 2025-09-26 下午3:23
 */

public enum SexEnum implements IEnum<Integer> {
    MAN(1, "男"),
    WOMEN(0, "女");

    private int code;

    private String value;

    SexEnum(int code, String value) {
        this.code = code;
        this.value = value;
    }

    @Override
    public Integer getValue() {
        return this.code;
    }

    //注意要重写此方法，不然会将值转换成 ‘MAN’，而不是 ‘男’
    @Override
    public String toString() {
        return this.value;
    }
}
